Text

__________________________________________
TextFont  *388*

Input names:   font

Input types:   integer

Description:   Sets the current grafPort’s font to the given font. The initial font number is 0, the system font.

 You can use the following constants to specify the font; for more information see Inside Macintosh.

constant value 

applFont
1

athens
7

cairo
11

courier
22

geneva
3

helvetica 
21

losAngeles
12

monaco 
4

newYork 
2

sanFran 
8

systemFont
0  (normally Chicago)

times
20

toronto 
9

venice
5

__________________________________________
TextFace *389*

Input names:   face

Input types:   integer

Description:   Sets the current grafPort’s character style to one or a combination of bold, italic, underline, outline, shadow, condense, and extend. The names “bold”…“extend” are names of Macintosh constants. Combinations are created by adding (or ORing using the bit-or primitive) together the values of the appropriate constants.

       

__________________________________________
TextMode *389*

Input names:   mode

Input types:   integer

Description:   Sets the current grafPort’s transfer mode for drawing text. The mode should be srcOr, srcXor, or srcBic.

__________________________________________
TextSize  *390*

Input names:   size

Input types:   integer

Description:   Sets the current grafPort’s font size to the given number of points.  The initial setting is 0, the system font size (12 points).

__________________________________________
SpaceExtra  *390*

Input names:   extra

Input types:   integer

Description:   Sets the current grafPort to specify the average number of pixels by which to widen each space in a line of text.

__________________________________________
DrawChar  *390*

Input names:   ch

Input types:   integer

Description:   Draws the character at the current pen location.

__________________________________________
DrawString  *390*

Input names:   s

Input types:   string

Description:   Draws the string at the current pen location.

__________________________________________
DrawText  *390*

Input names:   textBuf, firstByte, byteCount

Input types:   Ptr, integer, integer

Description:   Draws the string(s) up to byteCount characters in the textBuf at the current pen location.

__________________________________________
CharWidth  *391*

Input names:   ch

Input types:   integer

Output names:  
width

Output types:   integer

Description:   Returns the width of the specified character.

__________________________________________
StringWidth *391*

Input names:   s

Input types:   string

Output names:   width

Output types:   integer

Description:   Returns the width of the specified string.

__________________________________________
TextWidth  *391*

Input names:   textBuf, firstByte, byteCount

Input types:   Ptr, integer, integer

Output names:   width

Output types:   integer

Description:   Returns the width of the text stored in textBuf, for byteCount characters.

__________________________________________
Drawing in Color  *391*

You can use the following constants to specify the foreground and background colors; for more information, see Inside Macintosh.

constant value 

blackColor
33

whiteColor
30 

redColor
205

greenColor
341

blueColor
409

cyanColor
273

magentaColor
137

yellowColor
69

__________________________________________
ForeColor  *392*

Input names:   color

Input types:   integer

Description:   Sets the foreground color for all drawing in the current grafPort to the given color.

__________________________________________
BackColor  *392*

Input names:   color

Input types:   integer

Description:   Sets the background color for all drawing in the current grafPort to the given color.

__________________________________________
ColorBit  *392*

Input names:   whichBit

Input types:   integer

Description:   Called by printing software for a color printer, or other color-imaging software, to set the current grafport’s colrBit field to whichBit; this tells QuickDraw which plane of the color picture to draw into.

__________________________________________
RGB Colors  *392*

The following color calls work with the new red, green and blue colors as described in  Inside Macintosh.

__________________________________________
RGBForeColor  *392*

Input names:   color

Input types:   RGBColor

Description:   Sets the foreground color for all drawing in the current grafPort to the given color.

__________________________________________
RGBBackColor  *393*

Input names:   color

Input types:   RGBColor

Description:   Sets the background color for all drawing in the current grafPort to the given color.

__________________________________________
GetForeColor *393*

Input names:   color

Input types:   RGBColor

Output names:   color

Output types:   RGBColor *393*

Description:   Returns the RGB components of the foreground color set in the current grafPort.

__________________________________________
GetBackColor *393*

Input names:   color

Input types:   RGBColor

Output names:   color

Output types:   RGBColor

Description:   Returns the RGB components of the background color set in the current grafPort.

__________________________________________
SetCPixel *393*

Input names:   h, v, cPix

Input types:   integer, integer, RGBColor

Description:   Sets the pixel at the given position to the pixel value closest to the given RGB value, in the current grafPort.

__________________________________________
GetCPixel *393*

Output names:   h, v, cPix

Output types:   integer, integer, RGBColor

Description:   Gets the RGB value of the pixel at the given position in the current grafPort.

Rectangles

__________________________________________
Calculations with Rectangles  *394*

__________________________________________
SetRect *394*

Input names:   r, left, top, right, bottom

Input types:   Rect, integer, integer, integer, integer

Output names:  
r

Output types:   Rect  

Description:   Assigns the four boundary coordinates to the given rectangle. The result is a rectangle with coordinates (left,top) (right,bottom). 

__________________________________________
OffsetRect *394*

Input names:   r, dh, dv

Input types:   Rect, integer, integer 

Output names:   r

Output types:   Rect 

Description:   Moves the given rectangle by adding dh to each horizontal coordinate and dv to each vertical coordinate.  This doesn’t affect the screen unless a routine is subsequently called to draw within the rectangle.

__________________________________________
InsetRect *394*

Input names:   r, dh, dv

Input types:   Rect, integer, integer 

Output names:   r

Output types:   Rect 

Description:   Shrinks or expands the given rectangle.  The left and right sides are moved in by the amount specified by dh; the top and bottom are moved toward the center by the amount specified by dv.

__________________________________________
SectRect  *395*

Input names:   src1, src2, dstRect 

Input types:  
Rect, Rect, Rect

Output names:   dstRect, Boolean

Output types:   Rect, boolean

Description:   Calculates the rectangle that’s the intersection of the two given rectangles, and returns TRUE if they indeed intersect or FALSE if they don’t. 

__________________________________________
UnionRect  *395*

Input names:   src1, srct2, dstRect 

Input types:   Rect, Rect, Rect

Output names:   dstRect 

Output types:   Rect 

Description:   Calculates the smallest rectangle that encloses both of the given rectangles.

__________________________________________
PtInRect  *395*

Input names:   pt, r

Input types:   Point, Rect 

Output names:   Boolean

Output types:   boolean

Description:   Determines if the pixel below and to the right of the given coordinate point is enclosed in the specified rectangle, and returns TRUE if so or FALSE if not.

__________________________________________
Pt2Rect  *395*

Input names:   pt1, pt2, dstRect

Input types:  
Point, Point, Rect

Output names:   dstRect 

Output types:  
Rect 

Description:   Calculates the smallest rectangle that encloses the two given points.

__________________________________________
PtToAngle  *396*

Input names:   r, pt, angle

Input types:   Rect, Point, integer

Output names:   angle 

Output types:  
integer 

Description:   Calculates an integer angle between a line from the center of the rectangle to the given point and a line from the center of the rectangle pointing straight up (12 o’clock high).

__________________________________________
EqualRect  *396*

Input names:   rect1, rect2

Input types:   Rect, Rect 

Output names:   Boolean

Output types:   boolean

Description:   Returns a boolean for the comparison of the two rectangles:   TRUE if both have identical boundary coordinates, FALSE otherwise.

__________________________________________
EmptyRect  *396*

Input names:   r 

Input types:   Rect

Output names:   Boolean

Output types:   boolean

Description:   Returns TRUE if the given rectangle is an empty rectangle or FALSE if not.  A rectangle is considered empty if the bottom coordinate is less than or equal to the top or the right coordinate is less than or equal to the left. 

__________________________________________
Graphic Operations on Rectangles  *396*

NOTE:    The pen location is not changed by the procedures for graphic operations on rectangles, ovals, rounded-corner rectangles, arcs and wedges.

__________________________________________
FrameRect  *397*

Input names:   r 

Input types:   Rect

Description:   Draws an outline just inside the specified rectangle using the current grafPort’s pen pattern, mode, and size.

__________________________________________
PaintRect  *397*

Input names:   r 

Input types:   Rect

Description:   Paints the specified rectangle with the current grafPort’s pen pattern and mode. 

__________________________________________
EraseRect  *397*

Input names:   r 

Input types:   Rect

Description:   Paints the specified rectangle with the current grafPort’s background pattern bkPat.

__________________________________________
InvertRect  *397*

Input names:   r 

Input types:   Rect

Description:   Inverts the pixels enclosed by the specified rectangle:    every white pixel becomes black and every black pixel becomes white.

__________________________________________
FillRect  *397*

Input names:   r, pat 

Input types:   Rect, Pattern

Description:   Fills the specified rectangle with the given pattern.

__________________________________________
Ovals

__________________________________________
FrameOval  *398*

Input names:   r 

Input types:   Rect

Description:   Draws an outline just inside the oval that fits inside the specified rectangle using the current grafPort’s pen pattern, mode, and size.

__________________________________________
PaintOval *398*

Input names:   r 

Input types:   Rect

Description:   Paints an oval just inside the specified rectangle with the current grafPort’s pen pattern and mode.

__________________________________________
EraseOval  *398*

Input names:   r 

Input types:   Rect

Description:   Paints an oval just inside the specified rectangle with the current grafPort’s background pattern bkPat.

__________________________________________
InvertOval  *398*

Input names:   r 

Input types:   Rect

Description:   Inverts the pixels enclosed by an oval just inside the specified rectangle:    every white pixel becomes black and every black pixel becomes white.

__________________________________________
FillOval  *398*

Input names:   r, pat 

Input types:   Rect, Pattern

Description:   Fills an oval just inside the specified rectangle with the given pattern.